<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="__PUBLIC__/layui/css/layui.css"  media="all">
    <link rel="stylesheet" href="__PUBLIC__/font-awesome/css/font-awesome.min.css" media="all" />
    <link rel="stylesheet" href="__CSS__/admin.css"  media="all">
    <style type="text/css">

        /* tooltip */
        #tooltip{
            position:absolute;
            border:1px solid #ccc;
            background:#333;
            padding:2px;
            display:none;
            color:#fff;
        }
    </style>
</head>
<body style="padding:10px;">
<div class="tplay-body-div">
    <div class="layui-tab">
        <ul class="layui-tab-title">
            <li class="layui-this">项目列表</li>
            <li><a href="{:url('admin/project/publish')}" class="a_menu">新增/更新项目</a></li>
        </ul>
    </div>

    <table class="layui-table" lay-size="sm">
        <colgroup>
            <!--<col width="50">
            <col width="80">
            <col width="100">
            <col width="150">
            <col width="150">
            <col width="200">
            <col width="200">
            <col width="200">
            <col width="100">-->
        </colgroup>
        <thead>
        <tr>
            <th>ID</th>
            <th>项目名称</th>
            <th>优先级</th>
            <th>开发进度</th>
            <th>项目类型</th>
            <th>当前阶段</th>
            <th>开始时间</th>
            <th>结束时间</th>
            <th>预估完成时间</th>
            <th>预估天数</th>
            <th>项目经理</th>
            <th>需求方</th>
            <th>项目状态</th>
            <th>关联jira</th>
            <th>关联confluence</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        {volist name="project" id="vo"}
        <tr>
            <td>{$vo.project_id}</td>
            <td>{$vo.project_name}</td>
            <td>
                {if condition="$vo.project_level eq 10"}
                    低
                    {elseif condition="$vo.project_level eq 20" /}
                    中
                    {else /}
                    高
                {/if}
            </td>
            <td>{$vo.project_speed}%</td>
            <td>
                {if condition="$vo.project_level eq 1"}
                    ecr
                    {elseif condition="$vo.project_level eq 2" /}
                    bug
                    {else /}
                    其他
                {/if}
            </td>
            <td>
                {if condition="$vo.current_stage eq 10"}项目设计
                    {elseif condition="$vo.current_stage eq 20" /}需求设计
                    {elseif condition="$vo.current_stage eq 30" /}开发中
                    {elseif condition="$vo.current_stage eq 40" /}联调
                    {elseif condition="$vo.current_stage eq 50" /}冒烟测试
                    {elseif condition="$vo.current_stage eq 60" /}sit测试
                    {elseif condition="$vo.current_stage eq 70" /}uat测试
                    {elseif condition="$vo.current_stage eq 80" /}上线
                    {else /}其他
                {/if}
            </td>

            <td>{$vo.begin_time|date="Y-m-d",###}</td>
            <td>{$vo.end_time|date="Y-m-d",###}</td>
            <td>{$vo.estimate_time|date="Y-m-d",###}</td>
            <td>{$vo.estimate_day}</td>
            <td>{$vo.project_manager_id}</td>
            <td>{$vo.demand_person_id}</td>
            <td>
                {if condition="$vo.project_status eq 10"}进行中
                    {elseif condition="$vo.project_status eq 20" /}暂停
                    {elseif condition="$vo.project_status eq 30" /}已完成
                    {else /}
                {/if}
            </td>

            <td>{$vo.jira_id}</td>
            <td>{$vo.confluence_id}</td>

            <td class="operation-menu">
                <div class="layui-btn-group">
                    <a href="{:url('admin/project/publish',['project_id'=>$vo.project_id])}" class="layui-btn layui-btn-xs a_menu layui-btn-primary" id="{$vo.project_id}" style="margin-right: 0;font-size:12px;"><i class="layui-icon"></i></a>
                    <a href="{:url('admin/task/index',['project_id'=>$vo.project_id])}" class="layui-btn layui-btn-xs a_menu layui-btn-primary" style="margin-right: 0;font-size:12px;"><i class="layui-icon"></i></a>
                </div>
            </td>
        </tr>
        {/volist}
        </tbody>
    </table>
    <div style="padding:0 20px;">{$project->render()}</div>
    {include file="public/foot"}

    <script type="text/javascript">

        $('.delete').click(function(){
            var id = $(this).attr('id');
            layer.confirm('确定要删除?', function(index) {
                $.ajax({
                    url:"{:url('admin/admin/delete')}",
                    data:{id:id},
                    success:function(res) {
                        layer.msg(res.msg);
                        if(res.code == 1) {
                            setTimeout(function(){
                                location.href = res.url;
                            },1500)
                        }
                    }
                })
            })
        })
    </script>
</div>
</body>
</html>
